<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <alert-box>Bug happen</alert-box>
    <alert-box>Warning</alert-box>
    <alert-box></alert-box>
</div>

<script type="text/javascript">

    Vue.component('alert-box',{
        template:`
            <div>
                <div class="demo=alert-box"></div>
                <strong>Error!</strong>
                <slot>默认内容</slot>
            </div>
        `
    })
    var app = new Vue({
        el: '#app'
    })

</script>

</body>
</html>